import yaml


def read_yaml(path):
    yamlPath = 'F:/PycharmProjects/wx9afood/testdata/' + path
    try:
        from yaml import CLoader as Loader, CDumper as Dumper
    except ImportError:
        from yaml import Loader, Dumper
    try:
        with open(yamlPath, 'r', encoding='utf-8') as yaml_file:
            configData = yaml.load(yaml_file, Loader=yaml.FullLoader)
        return configData
    except IOError:
        print("---->读取配置文件出错，请检查是否存在" + path)
